<style>
@charset "utf-8";
/* CSS Document */

/************************************************/
table.gridtable td{
    text-align: center;
}
</style>
<script type="text/javascript">
 var PdfURL="<?php echo base_url();?>";
</script>

<div class="container top">

      <ul class="breadcrumb">
        <li>
          <a href="<?php echo site_url("admin"); ?>">
            <?php echo ucfirst($this->uri->segment(1));?>
          </a> 
          <span class="divider">/</span>
        </li>
        <li class="active">
          <?php echo ucfirst($this->uri->segment(2));?>
        </li>
      </ul>

											
      <div class="row">
        <div class="span12 columns">
          <div class="well">
            
          <?php   
              $attributes = array('class' => 'form-inline reset-margin', 'id' => 'myform');
              echo form_open('admin/reports/attendence_emp', $attributes); 
          ?>
          
			 <div class="input-group date startdate" data-date-format="yyyy-mm-dd"  style="width: 130px; float: left;">
				<input  name="start_date" id="start_date" class="form-control input_validate" type="text" value="<?php echo $start_date_selected; ?>" style="width: 100px">
				<span class="input-group-addon"><i class="icon-calendar"></i></span>
			 </div>
	       
	      
			 <div class="input-group date enddate" data-date-format="yyyy-mm-dd"  style="width: 130px; padding-left: 15px;float: left;">
				<input  name="end_date" id="end_date" class="form-control input_validate" type="text" value="<?php echo $end_date_selected; ?>" style="width: 100px">
				<span class="input-group-addon"><i class="icon-calendar"></i></span>
			 </div>
			 
			
            <?php
           
            
            $options_dept_id=array();
            $options_dept_id[" "]="All Depaertment";
            $options_dept_id["Science"]="Science";
            $options_dept_id["Humanities"]="Humanities";
            $options_dept_id["Business Studies"]="Business Studies";
            $options_dept_id["Bangla"]="Bangla";
            $options_dept_id["Engilish"]="Engilish";
            $options_dept_id["Mathematics"]="Mathematics";
            
            $options_academic_session =array();
            
            $academic_session=$_SESSION['academic_session'];
            foreach($academic_session as $row)
            {
            	$options_academic_session[$row["academic_session"]]=$row["academic_session"];

            }

            //save the columns names in a array that we will use as filter         
            $options_order = array();    
            $options_order['emp_id'] = "Emp ID";
            $options_order ['name'] = "Name";
           // $options_students ['dob'] = "DOB";
           // $options_students ['remarks'] = "Remarks";
            

           
     
              echo form_label('Name:', 'search_string', 'style="padding-left: 15px"');
              echo form_input('search_string', $search_string_selected, 'id="search_string" style="width: 120px; height: 26px;"');

              

              echo form_label('Department:', 'department');
              echo form_dropdown('dept_id', $options_dept_id, $dept_id_selected, 'id="dept_id" style="width: 140px;" ');

              echo form_label('Order by:', 'order');
              echo form_dropdown('order', $options_order, $order, 'id="order"  style="width: 80px;"');

              $data_submit = array('name' => 'mysubmit', 'class' => 'btn btn-primary', 'value' => 'Go');

              
              echo form_label('&nbsp;', '');

              echo form_submit($data_submit);

            echo form_close();
            ?>
           
          </div>

          <table class="globaltable globaltable-striped globaltable-bordered globaltable-condensed" >
            <thead>
              <tr>
                <th class="header">#</th>
                <th class="yellow header headerSortDown">Official ID</th>
                <th class="green header">Name</th>
                <th class="red header">Department</th>
                <th class="green header">Date and Time</th>
                <th class="red header">Remarks</th>
              </tr>
            </thead>
            <tbody>
            <?php
             $ind=1;
             foreach($employees as $row)
              {
                echo '<tr>'; 
                echo '<td>'.$ind++.'</td>';
                echo '<td>'.$row['EMP_ID'].'</td>';
                echo '<td>'.$row['name'].'</td>';
                echo '<td>'.$row['dept_id'].'</td>';
                echo '<td>'.$row['date_time'].'</td>';
                echo '<td>'.$row['in_out'].'</td>';
                echo '</tr>';
              }
              ?>      
            </tbody>
          </table>

          <div style="text-align: right;float: right;"> 
             <input type="button" value="Download PDF" class="btn btn-primary" onclick="download_emp_attendence_pdf()">
           </div>
           
          <?php echo '<div class="pagination">'.$this->pagination->create_links().'</div>'; ?>
           
           
      </div>
    </div>